<?php
/**
 * Created by PhpStorm.
 * User: 86159
 * Date: 2021/1/25
 * Time: 14:04
 */

namespace App\Services;


class BaseServices
{
    protected static $instance = [];

    private function __construct()
    {
    }

    private function __clone()
    {
    }

    /**
     * @return static
     */
    public static function getInstance()
    {
        if ((static::$instance[static::class] ?? []) instanceof static) {
            return static::$instance[static::class];
        }
        static::$instance[static::class] = new static();
        return static::$instance[static::class];
    }

}